function loadChapterList(selectedAlbumItemId:String)
{
	Packages.system.display.Progress.createInstance(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterListContainer"));

	if (displayMode.chapterList=="normal")
	{
		 Packages.log("loadChapterList: "+selectedAlbumItemId, "debug");
		
		if (selectedAlbumItemId==null)
		{
			if (chapterListNames!=null)
			{
				loadChapterList("-1");
				return;
			}
			
			var args=new Array();
			args.push("-1");
			Packages.modula.RequestCommand.request("HTTP", "restlet/books/"+bookId+"/chapters?startIndex=-1&count=-1", null, null, displayMode.chapterList, this, {container:"chapterListContainer", dynamicPortlet:dynamicPortletArr.chapterList, saved:"chapterListNames", invokeCall:"loadChapterList", invokeArgs:args});
		}
		else if (selectedAlbumItemId=="-1")
		{
			var args=new Array();
			args.push("-2");
			Packages.modula.RequestCommand.request("HTTP", "restlet/books/"+bookId+"/recordalbums?startIndex=0&count=1", null, Packages.model.vo.ChapterListView, displayMode.chapterList, this, {container:"chapterListContainer", dynamicPortlet:dynamicPortletArr.chapterList, invokeCall:"loadChapterList", invokeArgs:args, saved:"recordAlbumDetails"});
		}
		else if (selectedAlbumItemId=="-2")
		{
		selectedAlbumItemId=recordAlbumDetails.objects[0].recordAlbumId;	//
		selectedAlbumId=selectedAlbumItemId;	//

			Packages.modula.RequestCommand.request("HTTP", "restlet/recordalbums/"+selectedAlbumItemId+"/recordtasks?startIndex=-1&count=-1", null, Packages.model.vo.ChapterListView, displayMode.chapterList, this, {container:"chapterListContainer", dynamicPortlet:dynamicPortletArr.chapterList, rules:"doWrapper", chapterListNames:chapterListNames, saved:"recordTaskList"});
		}
	}
	else if (displayMode.chapterList=="expand")
	{
		if (selectedAlbumItemId==null)
		{
			Packages.modula.RequestCommand.request("HTTP", "restlet/books/"+bookId+"/recordalbums?startIndex=-1&count=-1", null, Packages.model.vo.ChapterListView, displayMode.chapterList, this, {container:"chapterListContainer", dynamicPortlet:dynamicPortletArr.chapterList, saved:"recordAlbumDetails", hidden:"chapterListCotentContainer"});
		}
		else 
		{
			Packages.modula.RequestCommand.request("HTTP", "restlet/recordalbums/"+selectedAlbumItemId+"/recordtasks?startIndex=-1&count=-1", null, Packages.model.vo.ChapterListView, displayMode.chapterList, this, {container:"chapterListContainer", dynamicPortlet:dynamicPortletArr.chapterList, rules:"doWrapper", albumDetails:recordAlbumDetails, selectedAlbumId:selectedAlbumItemId, chapterListNames:chapterListNames, saved:"recordTaskList"});
		}
		
	}
	
	dynamicPortletArr.chapterList="chapterListInfo";
}

function onChapterListInit()
{
	Packages.log("onChapterListInit", "debug");
	var chapterListContentContainer=Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterListContentContainer");
	Packages.log("chapterListContentContainer: "+chapterListContentContainer, "debug");
	Packages.system.render.Transition.irisType1(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterListContainer"));
	
	var evtTargetArr:Array=new Array();
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "albumCreateSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "albumListSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterUploadSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterRecordSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterReportSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "chapterPlaySpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "textViewSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "textDownloadSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "audioPlaySpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "audioDownloadSpot"));
	evtTargetArr.push(Packages.system.mlf.GateKeeper.scanElement(this._name, "mobileDownloadSpot"));
	Packages.system.events.StateFulButtonEvent.initialize(evtTargetArr);
}